<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Home extends CI_Controller {

    public function Home() {
        parent::__construct();
        $this->load->model('tt_model');

        $lang = $this->input->cookie('bid_cookie');
        $this->lang->load('home', $lang);
    }

    public function index() {
        $this->load->library('pagination');
        $config['base_url'] = base_url() . '/index.php/home/index';
        $config['total_rows'] = $this->tt_model->count_bid();
        $config['per_page'] = 15;
        $config['uri_segment'] = '3';

        $this->pagination->initialize($config);

        $data['result'] = $this->tt_model->select(check_get('search'), $config['per_page'], $this->uri->segment(3));
        $data['content'] = 'home';
        $data['header'] = $this->lang->line('top_menu_bid_num');
        /* $data['right'] = 'sunflower.jpg'; */
        $this->load->view('user_template', $data);
    }

}